package com.power.sifa.std.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  申请事项类型实体类
*/

@Entity
@ApiModel(value="申请事项类型")
@Data
@Table(name="Std_matter",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Std_matter.Std_matterPK.class) 用于复合组件
public class Std_matter extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "grpid#code")
    private String id;

    @ApiModelProperty(value = "事项编码")
    private String itemcode;

    @ApiModelProperty(value = "实施编码")
    private String handleitem;

    @ApiModelProperty(value = "事项名称")
    private String itemname;

    @ApiModelProperty(value = "顺序号")
    private Integer sortnum;

    @ApiModelProperty(value = "删除标志")
    private Integer deleted;

    @ApiModelProperty(value = "分组id")
    private String grpid;

    @ApiModelProperty(value = "事项类型")
    private String itemtype;

    @ApiModelProperty(value = "流程英文标识")
    private String processkey;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("itemcode", this.getItemcode());
        map.put("handleitem", this.getHandleitem());
        map.put("itemname", this.getItemname());
        map.put("sortnum", this.getSortnum());
        map.put("deleted", this.getDeleted());
        map.put("grpid", this.getGrpid());
        map.put("itemtype", this.getItemtype());
        map.put("processkey", this.getProcesskey());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Std_matterPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Std_matterPK pk = (Std_matterPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
